/**
 * AggregationService.java
 * ************************** 
 * @date May 9, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package gossipServices.aggregation;

import gossipServices.GossipService;
import gossipServices.aggregation.functions.AggregationUpdateFunction;

/**
 * Description: 
 * The service provided by the Aggregation algorithm.
 * It provides the actual update function that the Aggregation algorithm
 * is using.
 * It provides the value of the shared variable of Aggregation. 
 */
public interface AggregationService extends GossipService {

	/**
	 * Returns the actual update function the Aggregation algorithm is using
	 * into the computation
	 * @return updateFunction
	 */
	public AggregationUpdateFunction getAggregationFunction();
	
	/**
	 * Returns the last stable value of the Aggregation algorithm 
	 * before the actual epoch has been started.
	 * @return lastAggregationValue : SingleValueDouble
	 */
	public SingleValueDouble getLastStableValue();
	
	/**
	 * Returns the actual value of the Aggregation algorithm.
	 * The caller has to be careful to access it in a thread safe manner.
	 * @return
	 */
	public SingleValueDouble getActualValue();
}
